<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="{$Assets}layui/css/layui.css">
    <style type="text/css">
.layui-table-body{
    overflow: hidden;
}
.column_div{

}
.column_div ul{
  
}
.column_div ul li{
  float: left;
  width: 120px;
  margin:15px 40px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}
.column_div ul li img{
  width: 100%;
}
.clear{
  clear: both;
  height: 0px;
  overflow: hidden;
}

    </style>
</head>
<body>
{include file="public/header" /}
<div class="layui-btn-group demoTable" style="margin-left: 15px;">
    <button class="layui-btn" data-type="addproduct">添加产品</button>
</div>
<form class="layui-form" action="index" style="margin:10px 10px ;float: right;">
    <div class="layui-inline">
      <label class="layui-form-label">筛选</label>
      <div class="layui-input-inline">
        <select name="class">
          <option value="">请选择问题</option>
          {volist name="column" id="vo" }
                  <option value="{$vo.id}" 
                    {if condition="$class == $vo.id"} selected="" {/if}
                  ><?php echo str_repeat("&#8195;", $vo['level']);?>{if condition="$vo.level !=1"}└{/if}{$vo.classname}</option>
          {/volist}
        </select>
      </div>
      <button class="layui-btn" lay-submit="" lay-filter="demo1">确认</button>
    </div>
</form>
<div style="clear: both;">
</div>
<div style="width: 98%;margin:0 auto;">
    <div class="layui-card">
        <div class="layui-card-header">栏目</div>
        <div class="layui-card-body column_div">
          <ul>
{volist name="class" id="vo" }
            <li><a href="index?class={$vo.id}"><img src="{$Assets}images/{$vo.type}.png">{$vo.classname}</a></li>
{/volist}
<div class="clear"></div>
          </ul>
        </div>
    </div>
</div>

<script type="text/html" id="motion">
  <a class="layui-btn layui-btn-xs" lay-event="detail">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>


<script src="{$Assets}layui/layui.js?t=1515376178709"></script>
<script>
layui.use('table', function(){


  var $ = layui.$, active = {
    reload: function(){
      var demoReload = $('#prolist');
      
      //
      table.reload('testReload', {
        page: {
          curr: 1 // 1 
        }
        ,where: {
          key: {
            id: demoReload.val()
          }
        }
      });
    },
    
    addproduct:function(){


      //
      layer.open({
        type: 2 //iframe
        ,title: '添加产品'
        ,area: ['90%', '90%']
        ,shade: 0.8

        ,maxmin: true
        ,offset: 'auto'
        ,content: "{:url('product/addproduct')}"
        ,zIndex: layer.zIndex //1
        ,success: function(layero){
          layer.setTop(layero); //2
        }
      });


    },

  };
  
  $('.demoTable .layui-btn').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
});
</script>
{include file="public/footer"/}

</body>
</html>